﻿var deleteMsgTypeGridSelected = function (sender) {
    var grid = sender.up("grid");
    if (grid.hasSelection()) {
        Ext.Msg.confirm('提示', "是否删除选中的类别？", function (answer) {
            if (answer == "yes") {
                grid.deleteSelected();
            }
        });
    }
};

var beforeEditMsgType = function (editor, row) {
    if (row.record.internalId == 0) {
        return false;
    }
};

var changeMsgType = function (grid, record) {
    var typeId = record.internalId;
    App.GridPanel1.store.proxy.extraParams.typeId = typeId;
    App.GridPanel1.store.reload();
};

var onAuditSuccess = function (response, data) {
    Ext.Msg.show({ title: '提示', msg: data.extraParams.Msg, buttons: Ext.Msg.OK, icon: Ext.Msg.INFO, modal: true,
        fn: function (btn) {
            var grid = App.GridPanel1;
            if (grid != null) {
                grid.getStore().reload();
            }
        }
    });
};